package com.yjd.comm.borrow.service;

import java.util.List;
import java.util.Map;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.borrow.dto.BuyCreditorTransferDto;
import com.yjd.comm.borrow.dto.CreditorTransferApplyDto;
import com.yjd.comm.borrow.model.CreditorModel;

/**
 * <b>description</b>：用户详细信息业务接口<br>
 * <b>time</b>：2014-11-13 21:23:16 <br>
 * <b>author</b>： percy percy-chen@hotmail.com
 */
public interface ICreditorService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public CreditorModel insert(CreditorModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(CreditorModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param creditor_id
	 * @return
	 * @throws Exception
	 */
	public int delete(Long creditor_id) throws Exception;

	/**
	 * 更新 根据map
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("rawtypes")
	public int updateByMap(Map paramMap) throws Exception;

	/**
	 * 根据标的id获取债权列表
	 * 
	 * @param borrow_id
	 * @return
	 * @throws Exception
	 */
	public List<CreditorModel> getCreditorModelsByBorrowId(Long borrow_id)
			throws Exception;

	/**
	 * 批量插入债权数据
	 * 
	 * @param list
	 * @throws Exception
	 */
	public void inserts(List<CreditorModel> list) throws Exception;

	/**
	 * 发起债权转让申请，如果没有异常表示转让成功，请捕获BaseException异常
	 * 
	 * @param cfa
	 * @throws Exception
	 */
	public void creditorTransferApply(CreditorTransferApplyDto cfa)
			throws Exception;

	/**
	 * 取消债权转让申请
	 * 
	 * @param creditor_id
	 * @throws Exception
	 */
	public void cancelCreditorTransferByUser(Long creditor_id, Long user_id)
			throws Exception;

	/**
	 * 取消债权转让，并将债权转让记录的状态更新为取消状态
	 * 
	 * @param creditorModel
	 * @throws Exception
	 */
	public void cancelCreditorTransfer(CreditorModel creditorModel)
			throws Exception;

	/**
	 * 购买转让的债权，需捕获BaseException异常，没有异常表示成功
	 * 
	 * @throws Exception
	 */
	public void buyCreditorTransfer(BuyCreditorTransferDto bto)
			throws Exception;

}
